software =
{
    version = "0.1.0";
    description = "Firmware update for KAS PCMM2G";
    hardware-compatibility: [ "0.1" ];

    kas-pcmm2g = {
        /* booted into partition 3, install into partition 2 */
        rootfsB: {
            images: (
                {
                    filename = "kas-image-kas-pcmm2g.ext4.gz";
                    compressed = "zlib";
                    installed-directly = true;
                    device = "/dev/mmcblk1p2";
                }
            );
            bootenv: (
                {
                    name = "root_part";
                    value = "2";
                }
            );

        };

	/* booted into partition 2, install into partition 3 */
        rootfsA: {
            images: (
                {
                    filename = "kas-image-kas-pcmm2g.ext4.gz";
                    compressed = "zlib";
                    installed-directly = true;
                    device = "/dev/mmcblk1p3";
                }
            );
            bootenv: (
                {
                    name = "root_part";
                    value = "3";
                }
            );
        };

        /* booted into partition 3, install into partition 2 from USB image */
        rootfsB-usb: {
            images: (
                {
                    filename = "kas-image-usb-kas-pcmm2g.ext4.gz";
                    compressed = "zlib";
                    installed-directly = true;
                    device = "/dev/mmcblk1p2";
                }
            );
            bootenv: (
                {
                    name = "root_part";
                    value = "2";
                }
            );

        };

	/* booted into partition 2, install into partition 3 from USB image */
        rootfsA-usb: {
            images: (
                {
                    filename = "kas-image-usb-kas-pcmm2g.ext4.gz";
                    compressed = "zlib";
                    installed-directly = true;
                    device = "/dev/mmcblk1p3";
                }
            );
            bootenv: (
                {
                    name = "root_part";
                    value = "3";
                }
            );
        };        

	/* Backup to USB */
        mmc-image-to-usb: {
            images: (
                {
                    filename = "kas-image-kas-pcmm2g.ext4.gz";
                    compressed = "zlib";
                    installed-directly = true;
                    device = "/dev/sda2";
                }
            );
        };
        usb-image-to-usb: {
            images: (
                {
                    filename = "kas-image-usb-kas-pcmm2g.ext4.gz";
                    compressed = "zlib";
                    installed-directly = true;
                    device = "/dev/sda2";
                }
            );
        };

	/* Restore from USB */
        usb-image-to-mmc: {
            images: (
                {
                    filename = "kas-image-usb-kas-pcmm2g.ext4.gz";
                    compressed = "zlib";
                    installed-directly = false;
                    device = "/dev/mmcblk1p2";
                },
                {
                    filename = "kas-image-usb-kas-pcmm2g.ext4.gz";
                    compressed = "zlib";
                    installed-directly = false;
                    device = "/dev/mmcblk1p3";
                }
            );
        };
	/* in case the USB is made from a backup and we're
	   restoring from USB */
        mmc-image-to-mmc: {
            images: (
                {
                    filename = "kas-image-kas-pcmm2g.ext4.gz";
                    compressed = "zlib";
                    installed-directly = false;
                    device = "/dev/mmcblk1p2";
                },
                {
                    filename = "kas-image-kas-pcmm2g.ext4.gz";
                    compressed = "zlib";
                    installed-directly = false;
                    device = "/dev/mmcblk1p3";
                }
            );
        };
    }
}

